package com.ruoyi.sysem.config;

import org.kie.api.KieServices;
import org.kie.api.runtime.KieContainer;
import org.kie.api.runtime.KieSession;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class DroolsConfig {

       @Bean
    public KieSession kieSession(){

        // 第一步
        KieServices kieServices = KieServices.Factory.get();
        // 第二步
        KieContainer kieContainer = kieServices.getKieClasspathContainer();
        // 第三步
        KieSession kieSession = kieContainer.newKieSession();
        return kieSession;
    }
}
